<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>    
</body>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=amX9OmZ5XWiQToADtF9ogqcxmUuTGVrg"></script>
<script>
const myCity = new BMap.LocalCity();
myCity.get(function myFun(result){
    const cityName = result.name;
    console.log(result);  
}); 
</script>
</html>